<template>
  <view class="good-item">
    <view class="img-box">
      <image class="img-small" :src="goods.goods_small_logo"></image>
      <image class="img-big" :src="goods.goods_big_logo"></image>
    </view>
    <view class="word-box">
      <view class="word-name">{{goods.goods_name}}</view>
      <view class="word-price">￥{{goods.goods_price | tofixed}}</view>
    </view>
  </view>

</template>

<script>
  export default {
    name: "my-goods",
    props: {
      goods: {
        type: Object,
        default: {}
      }
    },
    data() {
      return {

      };
    },
    //过滤器
    filters:{
      tofixed(num){
        return Number(num).toFixed(2)
      }
    }
  }
</script>

<style lang="scss">
  .good-item {
    display: flex;
    margin: 10px;
    border-bottom: 1px solid #efefef;
    .img-box {
      display: block;
      width: 200rpx;
      height: 200rpx;
      padding: 10px;
    
      .img-small {
        width: 50rpx;
        height: 50rpx;
      }
    
      .img-big {
        width: 200rpx;
        height: 150rpx;
      }
    }
    
    .word-box {
      height: 200rpx;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      margin: 10px;
    
      .word-name {
        font-size: 26rpx;
      }
    
      .word-price {
        color: #c00000;
      }
    }
  }
  
</style>